const mongoose = require('./db.js');//引入数据库连接模块

const Schema = mongoose.Schema;//拿到数据库对应的集合对象

const proallSchema = new Schema({
    proid: {type: String },
    type: { type: String },
    brand: { type: String },
    barndimg: { type: String },
    proname: { type: String },
    price: { type: Number },
    flag: { type: Number }, // 是否推荐
    proimg: { type: String },
    note: { type: String },
    classification: { type: String },
    title: { type: String },
    classifyBean: [{
        classifyCode: { type: String },
        classifyName: { type: String },
        picPath:{type:String}
    }],
    classifySonBean: [{
            classifyCode:{type:String} ,
            classifySonCode:{type:String} ,
            classifySonName: {type:String},
            picPath: {type:String},
            classifyThirdBean:[{
                    classifySonCode: {type:String},
                    classifyThirdCode: {type:String},
                    classifyThirdName: {type:String},
                    picPath:{type:String}
            }]

    }]



})//设计用户集合的字段以及数据类型


module.exports = mongoose.model('Proall', proallSchema,'proalls');
